// 引入axios
import axios from 'axios'
import baseurl from './baseurl'
// 封装axios
const request = axios.create({
    baseURL: baseurl.baseurl,
    timeout: 5000
})
//封装请求
const http = async (url, method, data) => {
    try {
        const response = await request({
            url: url,
            method,
            data:data||{}
        })
        return response.data
    } catch (err) {
        console.log(err)
    }

}
// 导出
export default http
